package com.xu.cloud.sample.config;

import com.xu.cloud.common.process.IProcessSelector;
import com.xu.cloud.common.process.support.BestMatchedProcessSelector;
import com.xu.cloud.common.sequence.SequenceGenerator;
import com.xu.cloud.common.sequence.SimpleSnowflakeIdGenerator;
import com.xu.cloud.common.sequence.wrapper.DateTimeFormatSequenceWrapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xuguan
 * @since 2025/3/7
 */
@Configuration
public class BaseConfig {
    @Bean
    public SequenceGenerator sequenceGenerator() {
        return new DateTimeFormatSequenceWrapper(
                new SimpleSnowflakeIdGenerator(1, 1));
    }

    @Bean
    public IProcessSelector processSelector() {
        return new BestMatchedProcessSelector();
    }
}
